<?php
/**
 * OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures
 * all the essential functionalities required for any enterprise.
 * Copyright (C) 2006 OrangeHRM Inc., http://www.orangehrm.com
 *
 * OrangeHRM is free software; you can redistribute it and/or modify it under the terms of
 * the GNU General Public License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * OrangeHRM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program;
 * if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301, USA
 *
 */
$styleSheet = "orange";

$GLOBALS['lang_Common_SortAscending'] = $lang_Common_SortAscending;
$GLOBALS['lang_Common_SortDescending'] = $lang_Common_SortDescending;

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../../themes/<?php echo $styleSheet; ?>/css/style.css" rel="stylesheet" type="text/css"/>
<!--[if lte IE 6]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE6_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<!--[if IE]>
<link href="../../themes/<?php echo $styleSheet; ?>/css/IE_style.css" rel="stylesheet" type="text/css"/>
<![endif]-->
<script type="text/javascript" src="../../themes/<?php echo $styleSheet;?>/scripts/style.js"></script>
<link type="text/css" rel="stylesheet" href="/themes/orange/css/yui/calendar/assets/calendar.css" />
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="../../scripts/octopus.js"></script>
<script type="text/javascript" src="../../scripts/common.js"></script>
<script type="text/javascript" src="../../scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="../../scripts/yui/yahoo/yahoo-min.js"></script>
<script type="text/javascript" src="../../scripts/yui/event/event-min.js" ></script>
<script type="text/javascript" src="../../scripts/yui/dom/dom-min.js" ></script>

<script type="text/javascript" src="../../scripts/yui/container/container-min.js"></script>
<script type="text/javascript" src="../../scripts/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="../../scripts/yui/element/element-beta-min.js"></script>

<script type="text/javascript" src="../../scripts/yui/calendar/calendar.js"></script>
<script type="text/javascript" src="../../scripts/yui/button/button-beta-min.js"></script>

<script type="text/javascript" src="../../scripts/yui/animation/animation-min.js"></script>
<script type="text/javascript" src="../../scripts/yui/autocomplete/autocomplete-min.js"></script>
<script type="text/javascript" src="../../scripts/time.js"></script>

<script type="text/javascript" src="../../scripts/calendar/calendar.js"></script>
<script type="text/javascript">
YAHOO.namespace("OrangeHRM.time");

YAHOO.OrangeHRM.calendar.format = 'yyyy-MM-dd';
YAHOO.OrangeHRM.calendar.formatHint.format = '';
YAHOO.OrangeHRM.time.format = 'HH:mm';
	function add() {

	/*var cnt = document.GoodsRecord.EmpId;
	if(!(cnt.value == '') && !alpha(cnt) && !confirm('员工id不能为空')) {
		cnt.focus();
		return;
	}  if (cnt.value == '') {
		alert('<?php echo $lang_Error_LastNameEmpty?>');
		cnt.focus();
		return;
	}

	var cnt = document.GoodsRecord.Content;
	if(!(cnt.value == '') && !alpha(cnt) && !confirm('领取内容不能为空')) {
		cnt.focus();
		return;
	} else if (cnt.value == '') {
		alert('<?php echo $lang_Error_FirstNameEmpty?>');
		cnt.focus();
		return;
	}*/



	//document.GoodsRecord.sqlState.value = "NewRecord";
	document.standardView.submit();
}
	function clear_form() {
		document.standardView.loc_code.options[0].selected=true;
		document.standardView.loc_name.value='';
	}
</script>
<div class="formpage2col">
<form name="standardView" id="standardView" method="post" action="<?php echo $_SERVER['PHP_SELF']?>?adcode=whitelist&action=save">
	<div class="outerbox">
		<div class="mainHeading"><h2>添加白名单</h2></div>
		<input type="hidden" name="Id" value="<?php echo isset($records['Id']) ? $records['Id']:'';?>" />
		<input type="hidden" name="EmpId" id="EmpId" value="" />

		<label for="txtEmpLastName">员工名字 <span class="required">*</span></label>
		<input type="text" name="EmpName" id="EmpName" class="formInputText" 
			value="<?php echo isset($records['EmpId']) ? $records['EmpId']:'';?>" onblur="GetEmpListName('<?php echo $_SERVER['PHP_SELF']?>?adcode=GetEmpName','tbname','EmpName','ShowEmpName','EmpId')"/><br>
		<div id="ShowEmpName" class="shownameclass" style="display:none"><table id="tbname" width="350" border="0" cellspacing="0" cellpadding="0"></table></div>
		<br class="clear" />
		<label for="txtEmpFirstName" id="txtEmpFirstName">开始时间 <span class="required">*</span></label>
		
		<input type="text" readonly name="StartTime" id="StartTime" class="formInputText" 
			value="<?php echo isset($records['StartTime']) ? @date('Y-m-d',$records['StartTime']):@date('Y-m-d');?>"/>
			<input type="button" class="calendarBtn" value="" name="Submit">
            <select name="StartTime_hour" class="formSelect" style="width:50px;">
            <?PHP 
			for($i=0;$i<24;$i++){
				if(!empty($records['StartTime']) && date('H',$records['StartTime']) == $i){
					echo "<option value=\"".$i."\"  selected=\"selected\">".$i."时</option>";
				}else{
					echo "<option value=\"".$i."\">".$i."时</option>";
				}
			}
			?>
            </select>
            <select name="StartTime_min" class="formSelect" style="width:50px;">
            <?PHP 
			for($j=0;$j<61;$j++){
				if($j % 5 ==0){
					if(!empty($records['StartTime']) && date('i',$records['StartTime']) == $j){
						echo "<option value=\"".$j."\" selected=\"selected\">".$j."分</option>";
					}else{
						echo "<option value=\"".$j."\">".$j."分</option>";
					}
				}
			}
			?>
            </select>
		<br class="clear" />

		<label for="txtEmpMiddleName">结束时间</label>
		<input type="text" readonly name="EndTime" id="EndTime" class="formInputText"  value="<?php echo isset($records['EndTime']) ? @date('Y-m-d',$records['EndTime']):'';?>"/>
		<input type="button" class="calendarBtn" value="" name="Submit">
        <select name="EndTime_hour" class="formSelect" style="width:50px;">
            <?PHP 
			for($i=0;$i<24;$i++){
				if(!empty($records['EndTime']) && date('H',$records['EndTime']) == $i){
					echo "<option value=\"".$i."\"  selected=\"selected\">".$i."时</option>";
				}else{
					echo "<option value=\"".$i."\">".$i."时</option>";
				}
			}
			?>
            </select>
            
            <select name="EndTime_min" class="formSelect" style="width:50px;">
            <?PHP 
			for($j=0;$j<61;$j++){
				if($j % 5 ==0){
					if(!empty($records['EndTime']) && date('i',$records['EndTime']) == $j){
						echo "<option value=\"".$j."\" selected=\"selected\">".$j."分</option>";
					}else{
						echo "<option value=\"".$j."\">".$j."分</option>";
					}
				}
			}
			?>
            </select>
		<br class="clear"/>
		<?php  if(isset($records['Id']) && $records['Id'] > 0) { ?>
		<label for="txtEmpMiddleName">添加时间</label>
		<?php echo isset($records['AddTime']) ? $records['AddTime']:'';?>
		<br class="clear"/>
		<?php } ?>
		
        <div class="formbuttons">
			<input type="button" class="savebutton" id="btnEdit" onclick="add(); return false;"
				onmouseover="moverButton(this);" onmouseout="moutButton(this);"
				value="<?php echo $lang_Common_Save;?>" title="<?php echo $lang_Common_Save;?>" />
			<input type="button" class="resetbutton" onclick="document.GoodsRecord.reset(); return false;"
				onmouseover="moverButton(this);" onmouseout="moutButton(this);"
				 value="<?php echo $lang_Common_Reset;?>" />
        </div>
	</div>
	<div class="requirednotice"><?php echo preg_replace('/#star/', '<span class="required">*</span>', $lang_Commn_RequiredFieldMark); ?>.</div>
	</form>
</div>
<div id="cal1Container" style="position:absolute;" ></div>
<script type="text/javascript">
//<![CDATA[
    if (document.getElementById && document.createElement) {
        roundBorder('outerbox');
    }
//]]>
</script>
